<?php do_action( 'before' ); ?>
<?php if ( (in_array( 'woocommerce/woocommerce.php', apply_filters( 'active_plugins', get_option( 'active_plugins' ) ) ) || (in_array( 'jigoshop/jigoshop.php', apply_filters( 'active_plugins', get_option( 'active_plugins' ) ) ))) ) { ?>
<?php global $woocommerce; ?>
<div class="top-form top-form-minicart">
	<div class="mini_cart_icon pull-right" >
		<a class="cart-contents" href="<?php echo $woocommerce->cart->get_cart_url(); ?>" title="<?php _e('View your shopping cart', 'woothemes'); ?>">
                    <i class="icon-shopping-cart icon-large"></i><?php echo $woocommerce->cart->get_cart_total(); ?>
		</a>
	</div>
	<div class="wrapp-minicart">
		<ul class="minicart-content list-unstyled">
		<?php foreach($woocommerce->cart->cart_contents as $cart_item): ?>
			<li>
				<a href="<?php echo get_permalink($cart_item['product_id']); ?>">
					<?php $thumbnail_id = ($cart_item['variation_id']) ? $cart_item['variation_id'] : $cart_item['product_id']; ?>
					<?php echo get_the_post_thumbnail($thumbnail_id, 'shop_thumbnail'); ?>
					 <div class="cart-desc">
						<span class="cart-title"><?php echo $cart_item['data']->post->post_title; ?></span>
						<div class="block-qty">
							<?php echo $woocommerce->cart->get_product_subtotal($cart_item['data'], 1); ?>
							<span class="product-quantity">Qty:<?php echo '<span class="quantity_minicart">'.$cart_item['quantity'].'</span>'; ?></span>
						</div>
					</div>
				</a>
			</li>
		<?php
		endforeach;
		?>
		</ul>
		<div class="cart-checkout">
			<div class="cart-link"><a href="<?php echo get_permalink(get_option('woocommerce_cart_page_id')); ?>"><?php _e('View Cart', 'Avada'); ?></a></div>
			<div class="checkout-link"><a href="<?php echo get_permalink(get_option('woocommerce_checkout_page_id')); ?>"><?php _e('Checkout', 'Avada'); ?></a></div>
		</div>
	</div>
</div>
<?php } ?>